<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>文件上传方式配置</title>

    <!--公共模块-->
    <div th:replace="~{layout}"></div>
</head>
<style>
    .layui-container {
        display: flex;
        justify-content: left; /* 水平居中 */
        align-items: start; /* 垂直居中 */
        height: 100vh; /* 例如，设置父元素的高度为视口高度 */
    }
    .layui-form-item{padding-top: 30px}
</style>
<body>

<div class="layui-container">
    <div class="admin-login-background">
        <div class="layui-form login-form">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">上传方式：</label>
                    <div class="layui-input-inline layui-form">
                        <select name="status">
                            <option value="">请选择文件上传方式</option>
                            <option value="1">sftp</option>
                            <option value="0">深证通</option>
                        </select>

                        <div class="layui-form-item">
                            <button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit=""
                                    lay-filter="login">确认
                            </button>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>
</div>



<script>
    console.log("test");
    layui.use(function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;

        // 进行登录操作
        form.on('submit(login)', function (data) {

            $.ajax({
                type: 'POST',
                url: ctx + 'sys/user/login',
                dataType: "JSON",
                data: JSON.stringify(data),
                contentType: "application/json",
                success: function (res) {
                    if (res.code == 0) {
                        layer.msg('登录成功', {time: 1000}, function () {
                            window.location = ctx + 'index/home';
                        });
                    } else {
                        layer.msg(res.msg);
                        $("#img").click();
                    }
                }
            })

            return false;
        });
    });
</script>
</body>
</html>